
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Grebok.Common;
using Grebok.Common.Configuration;

namespace EVegetable.Persistence.Test.DataManager
{
    public class TeBiz_CartManager : BaseManager
    {
        #region private field

        private static TeBiz_CartManager manager;
        #endregion

        #region Properties
        
        public Int32 CartID
        {
            get { return GetConfig<Int32>("CartID"); }
            set { SetConfig<Int32>("CartID", value); }
        }
        
        public Int32? GoodsID
        {
            get { return GetConfig<Int32?>("GoodsID"); }
            set { SetConfig<Int32?>("GoodsID", value); }
        }
        
        public Int32? GoodsQuantity
        {
            get { return GetConfig<Int32?>("GoodsQuantity"); }
            set { SetConfig<Int32?>("GoodsQuantity", value); }
        }
        
        public DateTime? ShoppingDate
        {
            get { return GetConfig<DateTime?>("ShoppingDate"); }
            set { SetConfig<DateTime?>("ShoppingDate", value); }
        }
        

        #endregion

        #region Constructor

        /// <summary>
        /// TeBiz_CartManager
        /// </summary>
        private TeBiz_CartManager()
        {
            IApplicationConfiguration configuration = ApplicationConfigurationFactor.CreateApplicationConfiguration();
            appPropertiese = new ApplicationProperties(configuration[PropertiesConst.TEBIZ_CART_PROPERTIES_FILE_NAME_KEY],
                configuration[PropertiesConst.TEBIZ_CART_PROPERTIES_SECTION_NAME_KEY]);

            appPropertieseValues = new Dictionary<string, object>();
        }
        #endregion

        #region TeBiz_CartManager Instance

        /// <summary>
        /// TeBiz_CartManager's Instance
        /// </summary>
        public static TeBiz_CartManager Instance
        {
            get
            {
                if (manager == null)
                {
                    manager = new TeBiz_CartManager();
                }
                return manager;
            }
        }
        #endregion

    }
}
